import Vue from 'vue'
import hljs from 'highlight.js'
//样式文件,我选的是atom-one-dark-reasonable样式 可以通过highlight.js/styles 选择其他css
// import 'highlight.js/styles/atom-one-dark-reasonable.css'
// import 'highlight.js/styles/atom-one-dark.css'
// import 'highlight.js/styles/xt256.css'
import 'highlight.js/styles/base16/summerfruit-dark.css'
// import 'highlight.js/styles/base16/summercamp.css'
// import 'highlight.js/styles/base16/spacemacs.css'

// 这里 挂载highlight
Vue.directive('highlight',function (el) {
    let element = el.querySelectorAll('pre code');
    if(element.length<=0){
        element = el.querySelectorAll('pre');
    }
    element .forEach((block)=>{
        hljs.highlightBlock(block)
    })
})
